//
// Created by taojiaheng on 2020/6/10.
//

#ifndef WEBSOCKETSERVER_TCP_H
#define WEBSOCKETSERVER_TCP_H
#include "Protocol.h"

class TCP: public Protocol {
public:
    TCP();
    ~TCP();
    // 实现夫类中的虚函数
    // 协议是否需握手
    bool is_handshake = false;
    // 检测分包位置
    int input(BUFF * buff, Connection* client) override;
    // 协议解码
    BUFF * decode(BUFF * _buff, Connection * client) override;
    // 协议编码
    BUFF * encode(BUFF * _buff, Connection * client) override;
    // 处理协议握手函数
    int handshake(BUFF * _buff, Connection * client) override;
};


#endif //WEBSOCKETSERVER_TCP_H
